package com.iris.live.services.data.repositories;

import com.iris.live.services.data.models.Lsh金融服务费Model;
import com.iris.live.services.data.models.Lsh金融服务费ModelPK;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.sql.Date;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import java.sql.Date;

/**
 * Created by xiO on 2016/11/24.
 */
public interface Lsh金融服务费Repository extends JpaRepository<Lsh金融服务费Model, Lsh金融服务费ModelPK>, JpaSpecificationExecutor<Lsh金融服务费Model> {

    @Modifying
    @Query("update Lsh金融服务费Model a set a.经销商指导值 = ?4 ,a.更新账号 = ?2,a.更新时间 = current_time where a.许可 = ?1 and a.日期 = ?3")
    int updateFinanceServeFreeGuidance(String permit, String username, Date date, String num);

    @Query("select a  from Lsh金融服务费Model a where a.许可 =?1 and a.日期=?2")
    Lsh金融服务费Model findByPermitAndDate(String permit, Date date);
}
